package com.waterworld.watch.common.net;


import com.waterworld.watch.common.bean.*;
import com.waterworld.watch.home.bean.RoleBean;

import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.Streaming;
import rx.Observable;

/**
 * Created by nhuan
 * Time:2018/12/12.
 */

public interface ApiService {
    //获取验证码
    @GET("{url}")
    Observable<BaseResultBean<String>> getAuthCode(@Path(value = "url",encoded = true)String url, @Query("phone") String phone, @Query("type") String type);

    //注册
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> register(@Path(value = "url",encoded = true)String url,@FieldMap Map<String,String> map);

    //登录
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean<String>> login(@Path(value = "url",encoded = true)String url, @FieldMap Map<String,String> map);

    //忘记密码
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> forgetPwd(@Path(value = "url",encoded = true) String url,@FieldMap Map<String,String> map);

    //修改密码
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> modifyPwd(@Path(value = "url",encoded = true)String url,@FieldMap Map<String,String> map);

    //修改手机号码
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> modifyPhone(@Path(value = "url",encoded = true)String url,@FieldMap Map<String,String> map);

    //修改用户信息
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> modifyUserInfo(@Path(value = "url",encoded = true)String url ,@FieldMap Map<String,String> map);

    //获取用户信息
    @GET("{url}")
    Observable<BaseResultBean<UserInfoBean>> getCurrentUser(@Path(value = "url",encoded = true)String url);

    //退出系统
    @POST("{url}")
    Observable<BaseResultBean> logout(@Path(value = "url",encoded = true)String url);

    //绑定手表
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean<RoleBean>> bindWatch(@Path(value = "url",encoded = true)String url, @FieldMap Map<String,Object> map);

    //保存或更新手表用户
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> saveWatchUserInfo(@Path(value = "url",encoded = true)String url,@FieldMap Map<String,Object> map);

    //检查imei
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean<ImeiBean>> checkImei(@Path(value = "url",encoded = true)String url, @FieldMap Map<String,Object> map);

    //切换手表
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> switchWatch(@Path(value = "url",encoded = true)String url,@FieldMap Map<String,Integer> map);

    //获取当前手表用户信息
    @GET("{url}")
    Observable<BaseResultBean<WatchUserInfoBean>> getCurrentWatchUserInfo(@Path(value = "url",encoded = true)String url);

    //获取用户绑定手表列表
    @GET("{url}")
    Observable<BaseResultBean<BindWatchBean[]>> listBindWatch(@Path(value = "url",encoded = true)String url);

    //获取绑定该手表的用户列表
    @GET("{url}")
    Observable<BaseResultBean<BindWatchUserBean[]>> listBindWatchUser(@Path(value = "url",encoded = true)String url);

    //移交管理权限
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> transferAuthority(@Path(value = "url",encoded = true)String url,@FieldMap Map<String,Integer> map);

    //解除绑定（自身或其他用户）
    //被解绑用户标识；不传默认解绑自身
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> unbindWatch(@Path(value = "url",encoded = true)String url,@FieldMap Map<String,Integer> map);

    //恢复出厂设置
    @POST("{url}")
    Observable<BaseResultBean> resumeFactory(@Path(value = "url",encoded = true)String url);

    //编辑主页功能区
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> editHomePagerFunction(@Path(value = "url", encoded = true) String url, @FieldMap Map<String, String> map);

    //获取所有功能
    @GET("{url}")
    Observable<BaseResultBean<String>> getAllFunction(@Path(value = "url", encoded = true) String url);

    //获取未应用的功能
    @GET("{url}")
    Observable<BaseResultBean<String>> getNotUseFunction(@Path(value = "url", encoded = true) String url);

    //获取手表通讯录
    @GET("{url}")
    Observable<BaseResultBean<AddressBookBean[]>> listAddressBook(@Path(value = "url", encoded = true) String url);

    //上传文件
    @Multipart  //采用multipart/from-data的请求方式,对应请求头中的Content-Type:multipart/from-data
    @POST("{url}")
    Observable<BaseResultBean<String>> uploadImg(@Path(value = "url",encoded = true)String url, @Part MultipartBody.Part body);

    //上传手表通讯录
    @POST("{url}")
    Observable<BaseResultBean> uploadAddressBook(@Path(value = "url", encoded = true) String url, @Body RequestBody body);

    //更新贴心设置
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> updateIntimateSet(@Path(value = "url", encoded = true) String url, @FieldMap Map<String, Object> map);

    //获取贴心设置
    @GET("{url}")
    Observable<BaseResultBean<IntimateSetBean>> getIntimateSet(@Path(value = "url", encoded = true) String url);

    //远程关机
    @POST("{url}")
    Observable<BaseResultBean> remoteShutdown(@Path(value = "url",encoded = true) String url);

    //获取课程表
    @GET("{url}")
    Observable<BaseResultBean<CourseBean>> getCourse(@Path(value = "url",encoded = true) String url);

    //上传课程表
    @POST("{url}")
    Observable<BaseResultBean> uploadCourse(@Path(value = "url",encoded = true) String url, @Body RequestBody body);

    //获取位置
    @GET("{url}")
    Observable<BaseResultBean<LocationBean>> getLocation(@Path(value = "url" ,encoded = true) String url);

    //获取最后位置
    @GET("{url}")
    Observable<BaseResultBean<LocationBean>> getLastLocation(@Path(value = "url" ,encoded = true) String url);

    //获取安全围栏列表
    @GET("{url}")
    Observable<BaseResultBean<ElectronicFenceBean[]>> getSecurityFence(@Path(value = "url" ,encoded = true) String url, @Query("pageNum") Integer pageNum,@Query("pageSize") Integer pageSize);

    //添加安全围栏
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> addSecurityFence(@Path(value = "url",encoded = true) String url,@FieldMap Map<String,Object> map);

    //更新安全围栏
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> updateSecurityFence(@Path(value = "url",encoded = true) String url,@FieldMap Map<String,Object> map);

    //启用/关闭安全围栏
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> isEnableSecurityFence(@Path(value = "url",encoded = true) String url,@FieldMap Map<String,Object> map);

    //删除安全围栏
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> deleteSecurityFence(@Path(value = "url",encoded = true) String url,@FieldMap Map<String,Object> map);

    //获取轨迹信息
    @GET("{url}")
    Observable<BaseResultBean<TrackBean[]>> getTrack(@Path(value = "url",encoded = true) String url, @Query("date") String date);

    //获取运动统计
    @GET("{url}")
    Observable<BaseResultBean<SportBean>> getSportsCount(@Path(value = "url",encoded = true) String url);

    //获取最后运动统计
    @GET("{url}")
    Observable<BaseResultBean<SportBean>> getLastSportsCount(@Path(value = "url",encoded = true) String url);

    //获取群列表
    @GET("{url}")
    Observable<BaseResultBean<ChatGroupBean[]>> listGroup(@Path(value = "url",encoded = true) String url);

    //获取用户管理手表列表
    @GET("{url}")
    Observable<BaseResultBean<UserInfoBean.WatchUser[]>> listManageWatch(@Path(value = "url",encoded = true) String url);

    //获取群允许添加的用户
    @GET("{url}")
    Observable<BaseResultBean<GroupAllowUserBean[]>> listGroupAllowUser(@Path(value = "url",encoded = true) String url, @Query("watchId") Integer watchId);

    //上传群头像
    @Multipart
    @POST("{url}")
    Observable<BaseResultBean<String>> uploadGroupHead(@Path(value = "url",encoded = true)String url, @Part MultipartBody.Part body);

    //创建群
    @POST("{url}")
    Observable<BaseResultBean> createGroup(@Path(value = "url", encoded = true) String url, @Body RequestBody body);

    //删除群
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> deleteGroup(@Path(value = "url", encoded = true) String url, @FieldMap Map<String,Object> map);

    //修改群图像
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> updateGroupHead(@Path(value = "url", encoded = true) String url, @FieldMap Map<String,Object> map);

    //修改群名称
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> updateGroupName(@Path(value = "url", encoded = true) String url, @FieldMap Map<String,Object> map);

    //获取群成员列表
    @GET("{url}")
    Observable<BaseResultBean<GroupMemberBean[]>> listGroupMember(@Path(value = "url",encoded = true) String url, @Query("groupId") Integer groupId);

    //添加群成员
    @POST("{url}")
    Observable<BaseResultBean> addGroupMember(@Path(value = "url", encoded = true) String url, @Body RequestBody body);

    //删除群成员
    @POST("{url}")
    Observable<BaseResultBean> deleteGroupMember(@Path(value = "url", encoded = true) String url, @Body RequestBody body);

    //退群
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> quitGroup(@Path(value = "url", encoded = true) String url, @FieldMap Map<String,Object> map);

    //发送群消息
    @POST("{url}")
    Observable<BaseResultBean<RespondMsgBean>> sendGroupMsg(@Path(value = "url", encoded = true) String url, @Body RequestBody body);

    //上传群语音
    @POST("{url}")
    Observable<BaseResultBean<RespondVoiceBean>> uploadGroupVoice(@Path(value = "url", encoded = true) String url, @Body RequestBody body);

    //获取群最新消息
    @GET("{url}")
    Observable<BaseResultBean<ChatMsgBean[]>> getGroupMsg(@Path(value = "url",encoded = true) String url,@Query("groupId") Integer groupId,@Query("msgId") Integer msgId,@Query("pageSize") Integer pageSize);

    //获取群历史消息
    @GET("{url}")
    Observable<BaseResultBean<ChatMsgBean[]>> listGroupMsg(@Path(value = "url",encoded = true) String url,@Query("groupId") Integer groupId,@Query("msgId") Integer msgId,@Query("pageNum") Integer pageNum,@Query("pageSize") Integer pageSize);

    //远程拍摄
    @POST("{url}")
    Observable<BaseResultBean> remotePhoto(@Path(value = "url", encoded = true) String url);

    //获取照片
    @GET("{url}")
    Observable<BaseResultBean<RemotePhotoBean[]>> listPhoto(@Path(value = "url",encoded = true) String url, @Query("pageNum") Integer pageNum ,@Query("pageSize") Integer pageSize);

    //删除照片
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> deletePhoto(@Path(value = "url", encoded = true) String url,@FieldMap Map<String,Object> map);

    //单向聆听
    @POST("{url}")
    Observable<BaseResultBean> oneWayListening(@Path(value = "url", encoded = true) String url);

    //获取日程列表
    @GET("{url}")
    Observable<BaseResultBean<ScheduleBean>> listSchedule(@Path(value = "url",encoded = true) String url, @Query("pageNum") Integer pageNum , @Query("pageSize") Integer pageSize);

    //添加日程
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> addSchedule(@Path(value = "url", encoded = true) String url,@FieldMap Map<String,Object> map);

    //更新日程
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> updateSchedule(@Path(value = "url", encoded = true) String url,@FieldMap Map<String,Object> map);

    //是否启用日程
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> isEnableSchedule(@Path(value = "url", encoded = true) String url,@FieldMap Map<String,Object> map);

    //删除日程
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> deleteSchedule(@Path(value = "url", encoded = true) String url,@FieldMap Map<String,Object> map);

    //获取通知消息列表
    @GET("{url}")
    Observable<BaseResultBean<NotificationBean[]>> getMessage(@Path(value = "url",encoded = true)String url,@Query("pageNum") Integer pageNum,@Query("pageSize") Integer pageSize);

    //同意绑定
    @FormUrlEncoded
    @POST("{url}")
    Observable<BaseResultBean> agreeBindWatch(@Path(value = "url",encoded = true)String url,@FieldMap Map<String,Object> map);

    //单向聆听用户
    @GET("{url}")
    Observable<BaseResultBean<AddressBookBean[]>> listOneWayListeningUser(@Path(value = "url",encoded = true)String url);

    //获取消息分类列表
    @GET("{url}")
    Observable<BaseResultBean<NotificationCategoryBean[]>> getMessageGroup(@Path(value = "url",encoded = true)String url);

    //获取消息列表
    @GET("{url}")
    Observable<BaseResultBean<NotificationDetailBean[]>> listMessage(@Path(value = "url",encoded = true)String url,@Query("pageNum") Integer pageNum,@Query("pageSize") Integer pageSize,@Query("msgId") Integer msgId,@Query("groupId") Integer groupId);
}
